<?php
include(DDROOT.'/plugin/miaozhe/fun.php');
?><?php  //多多
if(!defined('INDEX')){
	exit('Access Denied');
}
$parameter=dd_act();
extract($parameter);
		
$tuijian_lanmu_title='推荐商品';
$tuijian_lanmu_goods=$goods_class->index_list(array('code'=>$goods['code']),9,1,"code='".$goods['code']."' and id!=".$goods['id']);
foreach($tuijian_lanmu_goods as $k=>$row){
	if($row['data_id']!=$goods['data_id']){
		$tuijian_lanmu_goods[$k]['view']=u('tao','view',array('iid'=>iid_encode($row['data_id'])));
	}
}
$quanhoujia=number_format($goods['discount_price'],2);
$quanhoufan=$quanhoujia*$goods['fanli_bl'];
$css[]=TPLURL."/goods/quan/css/list.css";
$css[]=TPLURL."/goods/inc/css/view.css";
$js[]="js/jQuery.autoIMG.js";
include(TPLPATH.'/inc/header.tpl.php');
?>
<style type="text/css">
<!--
body { font-family:"微软雅黑"
}
.demo ul{position:relative;padding:0;margin:0;font-size:12px; z-index:999}
.demo ul li{visibility:hidden;color:#fff; background:#FF9900;position:absolute;top:0px;left:0px;width:400px;padding:15px;border-radius:5px;}/*显示li的内容的定位*/
.demo ul:hover li,.demo ul a:hover li{visibility:visible;}/*鼠标经过ul时，显示li的内容*/
.demo ul li a{margin-right:10px;color:#fff;line-height:28px;}
.demo ul .copy-link{float:right; border:1px solid #ff3366; padding:0 10px;height:52px;text-align:center;line-height:52px;background:#fff;color:#ff3366;display:inline-block;margin:0;font-size:16px;font-family:Microsoft Yahei;margin-left:15px;border-radius:3px; cursor:pointer}
.tg{padding:8px 0;width:400px;line-height:28px;color:#fff;border:0;  background:#FF9900; clear:both; position:relative}
.tg span{padding:8px 0;width:400px;line-height:28px;color:#fff; clear:both; position:relative}
-->
</style>
<script type="text/javascript">
function copyUrl2()
{
var Url2=document.getElementById("biao1");
Url2.select(); // 选择对象
document.execCommand("Copy"); // 执行浏览器复制命令
alert("已复制好，可贴粘。");
}
</script>
<script>
$(function(){
	var pic_url='<?=tb_img($goods['img'],800)?>';
	$('#goodspic').attr('src',pic_url);
	$(".shopright .shopitem_main_l").imgAutoSize(800,800);
	
	$('.my-like').click(function(){
		goodsShoucang($(this));
	});
	$('.tx_title .tx_saomiao').hover(function(){
		$(this).find('.tx_erweima').show();
	},function(){
		$(this).find('.tx_erweima').hide();
	})
});

</script>
<script language="javascript" type="text/javascript" src="http://static.bshare.cn/b/buttonLite.js"></script>
<script type="text/javascript" charset="utf-8" src="http://static.bshare.cn/b/bshareC1.js"></script>
<div class="mainbody">
  <div class="mainbody1200" style="margin-top:15px">
 
<?php if($dd_tpl_data['fanli-kg']['open']==0){?>
	<div class="liucheng">
		<ul class="flow">
			<li class="flow_1">
				<i></i>
				<span>通过本站去商家购买</span>
			</li>
			<li class="flow_2">
				<i></i>
				<span>以券后价 <em> <?=$quanhoujia?> </em> 元 下单并支付</span>
			</li>
			<li class="flow_3">
				<i></i>  <?php if($goods['fanli_bl']>0){?>	
				<span>确认收货后返给您 <em><?=number_format(($quanhoufan/ 100),2)?></em> </span><?php }else{?><span>确认收货后以实际得到的返利为准</span><?php }?>
			</li>
			<li class="flow_4">
				<i></i>
				<span>回本站查看我的返利并提取</span>
			</li>
		</ul>
	</div><?php }?>
 <div class="detail-wrap"> 
  <div class="detail-row clearfix">
<a rel="nofollow" target="_blank" class="img cnzzCounter click_url" dd-href="?mod=jump&act=s8&iid=<?=iid_encode($goods['data_id'])?>&url=" data-itemid="<?=$goods['data_id']?>" isconvert=1 href="<?=$goods['jump']?>" ><img  class="item-img" id="goodspic" src="images/310.gif" alt="<?=$goods['title']?>" width="400" /></a>
<div class="detail-col">
<a class="title clearfix cnzzCounter  click_url" dd-href="?mod=jump&act=s8&iid=<?=iid_encode($goods['data_id'])?>&url=" data-itemid="<?=$goods['data_id']?>" isconvert=1 href="<?=$goods['jump']?>" >
<?php if($goods['laiyuan_type']==1){?><span title="淘宝" class="taobao"></span><?php }?>
<?php if($goods['laiyuan_type']==2){?><span title="天猫" class="tmall"></span><?php }?>
<span class="title"><?=$goods['title']?></span>
</a>
<div class="coupon-wrap clearfix">
<span class="now-price"><?php if($goods['price_man']>0){?><b>(独享)</b> 券后价<?php }else{?>在售价<?php }?>&nbsp;&nbsp;&nbsp;&nbsp;<b>&yen;<em>
<?=$quanhoujia?>
</em></b></span>
<span class="org-price"><?php if($goods['price_man']>0){?>在售价<?php }else{?>原价<?php }?>&nbsp;&nbsp;&yen;<em> <?=number_format($goods['price'],2)?></em></span>
</div>

<?php if($goods['price_man']>0){?>	
<div class="text-wrap">
<span class="text-wrap-span">
<?php if($goods['fanli']>0){?>优惠券满<em><?=$goods['price_man']?></em>减<em><?=$goods['price_jian']?></em><?php }else{?>剩余优惠券<em><?=$goods['quan_surplus']?></em>张<?php }?>
</span>
<?php if($goods['sell']>0){?>	<span>已有<em><?=$goods['sell']?></em>人购买</span><?php }?>
</div>

<div class="buy-step clearfix">
<div class="buy-step-text">购买流程</div>
<div class="buy-step-first">
<span>
<em style="font-size:14px">优惠券</em>
<b>&yen;<?=$goods['price_jian']?></b>
</span>
<a rel="nofollow" class="coupon-btn" href="<?=$goods['lq_url']?$goods['lq_url']:'javascript:void(0)'?>" target="_blank" title="领券后请点击右边按钮下单">点击领取</a>
</div>
<div class="double-arrow">
<span></span>
</div>	  
<a class="buy-step-sec buy-btn cnzzCounter click_url" dd-href="?mod=jump&act=s8&iid=<?=iid_encode($goods['data_id'])?>&url=" data-itemid="<?=$goods['data_id']?>" isconvert=1 href="<?=$goods['jump']?>" target="_blank">
去<?php if($goods['laiyuan_type']==1){?>淘宝<?php }?>
<?php if($goods['laiyuan_type']==2){?>天猫<?php }?>下单</a>
   <?php if($dd_tpl_data['fanli-kg']['open']==0){?>   
<?php if($dduser['id']>0){?>
 <div class="demo"> <ul>
  <li><textarea cols="55" rows="11" id="biao1" class="tg">
【商品名称】：<?=$goods['title']?></br>
【原价】：<?=number_format($goods['price'],2)?> 元</br>
【本群独享】：<?=$goods['price_jian']?> 元优惠券！   先领券，后下单</br>
【券后价】：<?=$quanhoujia?> 元包邮秒杀！<?php if($goods['fanli_je']>0){?>	通过<?=WEBNAME?>再返利 <?=number_format(($quanhoufan/ 100),2)?> ！<?php }?>
【领券地址】：<?=$goods['lq_url']?$goods['lq_url']:'javascript:void(0)'?></br>
【下单地址】http://<?=URL?>/index.php?mod=goods&act=view&code=quan&id=<?=$goods['id']?>&rec=<?=$dduser['id']?></br>
<?=WEBNAME?>专享优惠！已抢购 <?=$goods['sell']?> 件！
	 </textarea></li>
<input type="button" class=copy-link onClick="copyUrl2()" value="复制推广" />
	   
</ul>
</div>
<?php }else{?>
<div class="desc"><span class="yqdl2"><a style="color:#ff0000" href="<?=u('user','login')?>" title="先登录再获取连接">请先登录</a></span></div>
<?php }?><?php }?>
</div>

<?php }else{?>	
<div class="text-wrap">
<span class="text-wrap-span">
返利比例<em><font color="#0066CC"><?=$goods['fanli_bl']?>%</font></em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 返利：<em><?=number_format(($quanhoufan/ 100),2)?></em> &nbsp;&nbsp;&nbsp;&nbsp;
</span> 
<span>&nbsp;&nbsp;&nbsp;&nbsp;已有<em><?=$goods['sell']?></em>人购买</span>
</div>
<div class="buy-step">
<div class="buybar">
     <a href="<?=$goods['jump']?>" class="buy-btn click_url" dd-href="?mod=jump&act=s8&iid=<?=iid_encode($goods['data_id'])?>&url=" data-itemid="<?=$goods['data_id']?>" isconvert=1 rel="nofollow" target="_blank"><?php if($dd_tpl_data['fanli-kg']['open']==0){?>返利模式购买<?php }else{?>	
	 去<?php if($goods['laiyuan_type']==1){?>淘宝<?php }?>
<?php if($goods['laiyuan_type']==2){?>天猫<?php }?>购买
 <?php }?></a>
			<a  class="item-like y-like my-like"  title="<?=$goods['is_shoucang']==1?'已收藏':'加入收藏'?>" data_id="<?=$goods['id']?$goods['id']:$goods['data_id']?>" class="like-ico item-like <?=$goods['is_shoucang']==1?'active':''?>" href="javascript:void(0)"><i class="heart"></i></a>
   <?php if($dd_tpl_data['fanli-kg']['open']==0){?>        		
<?php if($dduser['id']>0){?>
<div class="demo"> <ul>
  <li><textarea cols="55" rows="11" id="biao1" class="tg">
【商品名称】：<?=$goods['title']?></br>
【原价】：<?=number_format($goods['price'],2)?> 元</br>
【优惠价】：<?=$quanhoujia?> 元包邮秒杀！<?php if($goods['fanli_je']>0){?>	通过<?=WEBNAME?>再返利 <?=number_format(($quanhoufan/ 100),2)?> ！<?php }?>
【下单地址】http://<?=URL?>/index.php?mod=goods&act=view&code=quan&id=<?=$goods['id']?>&rec=<?=$dduser['id']?></br>
<?=WEBNAME?>专享优惠！已抢购 <?=$goods['sell']?> 件！
	 </textarea></li>
<input type="button" class=copy-link onClick="copyUrl2()" value="复制推广" />
<?php }else{?>
<div class="desc"><span class="yqdl"><a style="color:#ff0000" href="<?=u('user','login')?>" title="先登录再获取连接">请先登录</a></span></div>
<?php }?><?php }?> </div>			
</div>
<?php }?>
<?php if($dd_tpl_data['fanli-kg']['open']==0){?><img src="<?=TPLURL?>/goods/inc/images/yao.png" width="520"/><?php }?>

<div class="text2">
<span>如果您喜欢此宝贝，记得分享给您的朋友，一起享优惠：</span>
<div class="bdshare">
<div class="bdsharebuttonbox">
<a href="#" class="bds_more" data-cmd="more"></a>
<a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间"></a>
<a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博"></a>
<a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信"></a>
</div>
<script>
                        window._bd_share_config = {
                            "common": {
                                "bdSnsKey": {},
                                "bdText": "最近发现了一个领内部优惠券的网站，都是限时限量抢购，一般人享受不到的！性价比超高哦，分享给大家，保证你会惊喜滴！",
                                "bdMini": "2",
                                "bdMiniList": false,
                                "bdPic": "",
                                "bdStyle": "0",
                                "bdSize": "16"
                            }, "share": {}
                        };
                        with (document)0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
                    </script>
</div>
</div>

</div>
<div class="pos-right">
<p><span>大家都在抢</span></p>
<div class="pos-box">
<div class="pos-goods-list bot">
 <?php foreach($tuijian_lanmu_goods as $row){?>
<a class="pos-goods cnzzCounter" title="<?=$row['title']?>" href="<?=$row['url']?>">
<img alt="<?=$row['title']?>" src="<?=tb_img($row['img'],200)?>" />
<span><?php if($goods['price_man']>0){?>券后价<?php }else{?>在售价<?php }?>：&yen;<?php if($goods['price_quan1']>0){?><?=number_format($goods['price'],2)?><?php }else{?><?=number_format($goods['discount_price'],2)?><?php }?></span>
</a><?php }?>	
</div>
</div>
<div class="pos-act">
<a class="top-btn disabled" href="javascript:;"></a>
<a class="bot-btn " href="javascript:;"></a>
</div>
</div>
</div>
</div>

	
<script>
    (function(){
        // 领券箭头移动
        var direction='right';
        $(".buy-step").hover(function(){
            var css={
                'margin-left':'-12px'
            };
            if(direction==='right'){
                direction='left';
                css['margin-left']='-5px';
            }else{
                direction='right';
            }
            $('.double-arrow span').animate(css,arguments.callee);
        },function(){
            $('.double-arrow span').stop().css("margin-left","-12px");
        })
        // 右侧广告位
        var list = $(".pos-goods-list"),
            goods = $(".pos-goods"),
            hg = goods.outerHeight(true),
            len = goods.length,
            time = 500,
            timer = null;
        list.height(hg * len);
        $(".top-btn").on("click",function(){
            var _this = $(this),
                _top = parseInt(list.css("top"));
            if(_this.hasClass("disabled") || list.is(":animated")){
                return;
            }
            list.animate({
                "top" : _top + hg * 3
            },time,function(){
                if(parseInt(list.css("top")) == 0){
                    _this.addClass("disabled");
                    list.removeClass("top").addClass("bot");
                }else{
                    list.removeClass("bot").addClass("top");
                }
                $(".bot-btn").removeClass("disabled");
            });
        });
        $(".bot-btn").on("click",function(){
            var _this = $(this),
                _top = parseInt(list.css("top"));
            if(_this.hasClass("disabled") || list.is(":animated")){
                return;
            }
            list.animate({
                "top" : _top - hg * 3
            },time,function(){
                if(Math.abs(parseInt(list.css("top"))) == hg * (len - 3)){
                    _this.addClass("disabled");
                    list.removeClass("bot").addClass("top");
                }else{
                    list.removeClass("top").addClass("bot");
                }
                $(".top-btn").removeClass("disabled");
            });
        });
        timer = setInterval(function(){
            if(list.hasClass("bot")){
                $(".bot-btn").trigger("click");
            }else if(list.hasClass("top")){
                $(".top-btn").trigger("click");
            }
        },time * 10);
        $(".pos-right").hover(function(){
            clearInterval(timer);
        },function(){
            timer = setInterval(function(){
                if(list.hasClass("bot")){
                    $(".bot-btn").trigger("click");
                }else if(list.hasClass("top")){
                    $(".top-btn").trigger("click");
                }
            },time * 10);
        })
    })();
</script>
 <?php include(TPLPATH.'/goods/inc/jieshao.tpl.php');?>
</div>
</div>  
<?php include(TPLPATH.'/inc/tdj.tpl.php');?>
<?php include(TPLPATH.'/goods/jumpbox.tpl.php');?>
<?php 
include(TPLPATH.'/inc/footer.tpl.php');
?>
